<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>新增收货地址</title>
    <jsp:include page="../common/header.jsp"/>
    <jsp:include page="../../common/validform.jsp"></jsp:include>
    <script type="text/javascript" src="${pathUrl}/public/js/PCASClass.js"></script>
    <link href="${pathUrl}/public/css/address_add.css?v=${version}" rel="stylesheet" />
    <script type="text/javascript" src="${pathUrl}/public/js/PCASClass.js"></script>
    <script type="text/javascript">
      window.onload=function(){
          //初始化省市区
          var mypcas = new PCAS("province,所属省份","city,所属城市","area,所属地区");
      }

      //添加地址提交
      $(function() {
          //验证
          initValidFrom("#formMain",function(data){
              //回调方法
              if(data.status==1){
                 alert("地址添加成功");
                 var goodsId = data.data.goodsId;
                 var goodsNum = data.data.go_num;
                 parent.window.location.href=parent.window.location.href+"?goodsId="+goodsId+"&go_num="+goodsNum;
              }else{
                  //提示失败
                  alert(data.msg);
              }
          });
      });
    </script>
</head>
<body>
<form action="${pathUrl}/home/order/submitAddress" id="formMain" method="post">
    <input type="hidden" name="goodsId" value="${goodsId}" />
    <input type="hidden" name="go_num" value="${go_num}" />

    <div class="right-auto">
        <div class="bg-wrap" style="min-height:765px;">
            <div class="form-box">
                <dl class="form-group">
                    <dt>收件人姓名：</dt>
                    <dd>
                        <input name="userName" id="username" value="" type="text" class="input"  datatype="*2-100" sucmsg=" " nullmsg="请填写信息！">
                        <span class="Validform_checktip"></span></dd>
                </dl>
                <dl class="form-group">
                    <dt>所属地区：</dt>
                    <dd>
                        <select id="province" name="province" class="select"></select>
                        <select id="city" name="city" class="select"></select>
                        <select id="area" name="area" class="select" ></select>
                        <span class="Validform_checktip"></span></dd>
                </dl>
                <dl class="form-group">
                    <dt>详细地址：</dt>
                    <dd>
                        <input name="address" value="" id="address" type="text" class="input" value="" datatype="*2-100" sucmsg=" " nullmsg="请填写信息！">
                        <span class="Validform_checktip"></span></dd>
                </dl>
                <dl class="form-group">
                    <dt>手机号码：</dt>
                    <dd>
                        <input name="phone" id="phone" value="" type="text" class="input" datatype="m" sucmsg=" ">
                        <span class="Validform_checktip"></span></dd>
                </dl>
                <dl class="form-group">
                    <dt>电子邮箱：</dt>
                    <dd>
                        <input name="email" id="email" type="text" value="" class="input" >
                        <span class="Validform_checktip"></span></dd>
                </dl>
                <dl class="form-group">
                    <dt>邮政编码：</dt>
                    <dd>
                        <input name="code" id="code" value=""  type="text" class="input">
                        <span class="Validform_checktip"></span></dd>
                </dl>
                <dl class="form-group">
                    <dd>
                        <input id="btnSubmit" name="btnSubmit" type="submit" value="确认提交" class="submit">
                    </dd>
                </dl>
            </div>
        </div>
    </div>
    </form>
</body>
</html>